package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.ShopsMapper;
import com.hello.system.domain.Shops;
import com.hello.system.service.IShopsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 商家店铺信息Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ShopsServiceImpl extends ServiceImpl<ShopsMapper, Shops> implements IShopsService 
{
    private final ShopsMapper shopsMapper;

    /**
     * 查询商家店铺信息
     * 
     * @param shopId 商家店铺信息主键
     * @return 商家店铺信息
     */
    @Override
    public Shops selectShopsByShopId(Long shopId)
    {
        return shopsMapper.selectShopsByShopId(shopId);
    }

    /**
     * 查询商家店铺信息列表
     * 
     * @param shops 商家店铺信息
     * @return 商家店铺信息
     */
    @Override
    public List<Shops> selectShopsList(Shops shops)
    {
        return shopsMapper.selectShopsList(shops);
    }

    /**
     * 新增商家店铺信息
     * 
     * @param shops 商家店铺信息
     * @return 结果
     */
    @Override
    public int insertShops(Shops shops)
    {
        shops.setCreateTime(DateUtils.getNowDate());
        return shopsMapper.insertShops(shops);
    }

    /**
     * 修改商家店铺信息
     * 
     * @param shops 商家店铺信息
     * @return 结果
     */
    @Override
    public int updateShops(Shops shops)
    {
        shops.setUpdateTime(DateUtils.getNowDate());
        return shopsMapper.updateShops(shops);
    }


    /**
     * 批量删除商家店铺信息
     * 
     * @param shopIds 需要删除的商家店铺信息主键
     * @return 结果
     */
    @Override
    public int deleteShopsByShopIds(Long[] shopIds)
    {
        return shopsMapper.deleteShopsByShopIds(shopIds);
    }

    /**
     * 删除商家店铺信息信息
     * 
     * @param shopId 商家店铺信息主键
     * @return 结果
     */
    @Override
    public int deleteShopsByShopId(Long shopId)
    {
        return shopsMapper.deleteShopsByShopId(shopId);
    }
}
